﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web.Master" AutoEventWireup="true" CodeBehind="AdministracionSalas.aspx.cs" Inherits="SalaDeEnsayo.WebApplication.AdministracionSalas" %>

<%@ MasterType VirtualPath="~/Web.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMaster" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlSalas" runat="server" GroupingText="Salas" Height="441px" 
                style="margin-bottom: 14px">
                <div style="height:400px; width:100%; margin-left:150px; margin-bottom: 22px;">
                    <div>
                        <table class="detalle" style=" margin-left:120px;">
                            <tr>
                                <td><div style=" margin-top:10px;"><asp:Label ID="lblDesc" runat="server" Text="Nombre"></asp:Label></div></td>
                                <td><div style=" margin-top:10px;"><asp:TextBox ID="txtBuscar" runat="server" Width="300px"></asp:TextBox></div></td>
                                <td><div class="detalle2" style="width:240px; float:left; margin-top:10px;">
                                        <asp:Button ID="btnBuscar" runat="server" Text="Buscar" 
                                            onclick="btnBuscar_Click" CausesValidation="false"/>
                                        <%--<input id="btnAgregar" type="button" value="Agregar" onclick="Populate();"/>--%>
                                        <asp:Button ID="btnAgregar" runat="server" Text="Agregar" 
                                            onclick="btnAgregar_Click" CausesValidation="false"/>
                                    </div>
                                </td>
                            </tr>    
                            
                        </table>
                    </div>
                    <asp:GridView ID="grdSala" runat="server" AllowPaging="true" 
                    AlternatingRowStyle-CssClass="alt" AutoGenerateColumns="false" CellPadding="3" 
                    CssClass="mGrid" DataKeyNames="Id_Sala" HeaderStyle-ForeColor="White" 
                    HeaderStyle-HorizontalAlign="Center" PageSize=3
                    onpageindexchanging="grdSala_PageIndexChanging" 
                    onselectedindexchanged="grdSala_SelectedIndexChanged" 
                    PagerSettings-Mode="NumericFirstLast" PagerStyle-CssClass="pgr" 
                    RowStyle-VerticalAlign="Middle" ShowHeader="true" Width="700">
                    <PagerStyle CssClass="pgr" />
                    <EmptyDataTemplate>
                        No se encontraron datos de Salas.
                    </EmptyDataTemplate>
                        <PagerSettings Mode="NumericFirstLast" />
                        <RowStyle VerticalAlign="Middle" />
                        <Columns>
                            <asp:BoundField DataField="Id_Sala" HeaderText="Id" 
                                ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80" 
                                SortExpression="Id_Sala" >
                                <ItemStyle HorizontalAlign="Right" Width="80px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                                ItemStyle-Width="300" SortExpression="Nombre" >
                                <ItemStyle Width="300px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Descripcion" HeaderText="Descripcion" 
                                ItemStyle-Width="300" SortExpression="Descripcion" >
                                <ItemStyle Width="300px" />
                            </asp:BoundField>
                            <asp:TemplateField ItemStyle-Width="30px" Visible="true">
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnModificar" runat="server" CausesValidation="false" 
                                        CommandArgument='<%# Eval("Id_Sala") %>' ImageUrl="~/Images/Modificar.gif" 
                                        OnClick="btnModificar_Click" ToolTip="Selecccionar"/>
                                </ItemTemplate>
                                <ItemStyle Width="30px" />
                            </asp:TemplateField>
                            <asp:TemplateField ItemStyle-Width="30px" Visible="true">
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnEliminar" runat="server" CausesValidation="false" 
                                        CommandArgument='<%# Eval("Id_Sala") %>' ImageUrl="~/Images/prod_delete.jpg" Width="15" 
                                        OnClick="btnEliminar_Click" ToolTip="Eliminar"/>
                                </ItemTemplate>
                                <ItemStyle Width="30px" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center" />
                        <AlternatingRowStyle CssClass="alt" />
                    </asp:GridView>
                </div>
            </asp:Panel>
            <asp:Panel ID="pnlDetalle" runat="server" GroupingText="Detalle">
                <div>
                    <table class="detalle">
                        <tr>
                            <td>
                                <label for="Tipo">Id:</label>
                            </td>
                            <td>                   
                                <asp:TextBox ID="txtId_Sala" runat="server" Enabled="false"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="Nombre">Nombre:</label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtNombre" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="txtNombre" ErrorMessage="*"></asp:RequiredFieldValidator>
                           </td>
                        </tr>
                        <tr>
                            <td>
                                <label for="Descripcion">Descripci&oacute;n:</label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtDescripcion" runat="server" TextMode="MultiLine" 
                                    Height="60px" Width="244px" EnableTheming="True" 
                                    MaxLength="250"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                    ControlToValidate="txtDescripcion" ErrorMessage="*"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td align="left">
                                <div class="detalle2" style="width:240px; float:left; margin-top:10px;">
                                    <asp:Button ID="btnGuardar" runat="server" Text="Guardar" Visible="false"
                                        onclick="btnGuardar_Click" CausesValidation=true />
                                    <asp:Button ID="btnActualizar" runat="server" Text="Guardar" Visible="false"
                                        onclick="btnActualizar_Click" CausesValidation=true />
                                    <asp:Button ID="btnConfirmEliminar" runat="server" Text="Eliminar" Visible="false"
                                        onclick="btnConfirmEliminar_Click1" CausesValidation=false />
                                    <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" 
                                        onclick="btnCancelar_Click" CausesValidation=false />
                                </div>      
                            </td>
                         </tr>
                         <tr>
                            <td></td>
                            <td>
                                <asp:Label ID="lblDependencia" runat="server" Text="La sala tiene reservas pendientes. Eliminar de todas formas?" ForeColor="Red" Visible="False"></asp:Label>        
                            </td>
                        </tr>
                    </table>            
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script type="text/javascript" language="javascript">
        function Populate() {
            {
                //document.getElementById('<%=txtNombre.ClientID%>').value = "Hi";
                //document.getElementById("<%=txtTipoDescapacidad.ClientID%>").focus();
                //cuil.disabled = true;
                //cuil.style.backgroundColor = '#f4f4f4';
                //cuil.disabled = false;
                //cuil.style.backgroundColor = '#fff';
                document.getElementById('<%=btnGuardar.ClientID %>').style.display = 'block';
            }
        }
    </script>--%>
</asp:Content>